package T2;

public class Point {
//    表示坐标的 x,y
    private int x;
    private int y;

    public Point() {
        this(0,0); //初始化为0
    }

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    public double distance(Point p){

        double sqrt = Math.sqrt(Math.pow(this.x - p.x, 2) + Math.pow(this.y - p.y, 2));
        return sqrt;
    }

}

